package algorithm.view.prepare;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;


/**
 * @author bingo
 * @Description
 * @Date 2018/7/20
 */
public class Demo1 {
    public static void main(String[] args) {
        Frame f = new Frame();
        f.setSize(400,400);
        f.setVisible(true);
        f.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
f.setLayout(new FlowLayout());
        Button button = new Button("ewrt");
        f.add(button);
        f.add(button);
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("你再点试试！");
            }
        });
    }
}
